/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util.math;

import com.jme3.math.Quaternion;
import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f;

/**
 *
 * @author
 */
public class Convert {

    public static Vector3f toVector3f(float[] xyz) {
        return new Vector3f(xyz[0], xyz[1], xyz[2]);
    }
    
    public static Vector2f toVector2f(float []xy) {
        return new Vector2f(xy[0],xy[1]);
    }

    /**
     * Pass in this order: W, x, y, z
     * @param wxyz
     * @return 
     */
    public static Quaternion toQuaternion(float[] wxyz) {
        // Note the order to be passed to JMonkey: x,y,z,w
        return new Quaternion(wxyz[1], wxyz[2], wxyz[3], wxyz[0]);
    }
}
